<%@ Page language="c#" Inherits="Dimok.Aspx.Manager.Application.Application_New" EnableViewState="false" Buffer="true" CodeFile="~/Manager/Application/Application_New.aspx.cs" %>
<%@ Reference Control="~/Manager/Lib/Controls/Borrower.ascx" %>
<%@ Reference Control="~/Manager/Lib/Controls/Car.ascx" %>
<%@ Register TagPrefix="Car" TagName="Car" Src="/Manager/Lib/Controls/Car.ascx" %>
<%@ Register TagPrefix="LOAN" TagName="BUYERSORDER" Src="/Manager/Lib/Controls/BuyersOrder.ascx" %>
<%@ Register TagPrefix="WorkFlow" TagName="Action" Src="/Manager/Menu/Common/Action.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head runat="server">
<title>Application Info</title>
<meta http-equiv="Expires" content="-1" />
<meta name="vs_showGrid" content="False" />
<meta content="Microsoft Visual Studio 7.0" name="GENERATOR" />
<meta content="C#" name="CODE_LANGUAGE" />
<meta content="JavaScript" name="vs_defaultClientScript" />
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" CONTENT="-1" />
<link rel="stylesheet" type="text/css" href="/CSS/Outlook.css" />
<link rel="stylesheet" type="text/css" href="/Manager/CSS/CSS.css" />
<link rel="stylesheet" type="text/css" href="/Manager/Common/HTC/CSS.css" />
<link href="/CSS/navbar.css" rel="stylesheet" type="text/css" />
<?XML:NAMESPACE PREFIX="COOL"/>
<style>
@media print {
.hidePrint {display:none}
}
@media All {
cool\:tip{behavior: url(/Include/HTC/cooltip_js.htc)}
	cool\:button { BEHAVIOR: url(/include/HTC/coolbutton_js.htc); TEXT-ALIGN: center }
}
FIELDSET {MARGIN-LEFT:3px;MARGIN-BOTTOM:3px;PADDIN-LEFT:2px;display:inline}
TEXTAREA { FONT-WEIGHT: bolder; FONT-SIZE: 8pt }
LEGEND {BEHAVIOR: url(/Include/HTC/Toggle.htc);COLOR:navy;FONT-WEIGHT:bold}
.headLine { BACKGROUND-COLOR: silver; TEXT-ALIGN: center }
.headLineOld { BORDER-RIGHT: darkgray outset; BORDER-TOP: darkgray outset; BORDER-LEFT: darkgray outset; BORDER-BOTTOM: darkgray outset; BACKGROUND-COLOR: silver; TEXT-ALIGN: center }
.selected { COLOR: white; BACKGROUND-COLOR: navy }
.dsTable { BEHAVIOR: url(/include/htc/TableDataSrc.htc) }
.bigList{behavior:URL(/include/htc/BigList.htc)}
</style>
</head>
<body style="FONT-WEIGHT: normal; vertical-align:top; FONT-SIZE: 18pt; FONT: menu; OVERFLOW-Y: auto; BACKGROUND-COLOR: menu;margin-left:3px" onload="page_Load()" bottomMargin="0" leftmargin="0" topmargin="0" rightMargin="0" onkeypress="if(event.keyCode!=21)return;swapFrames();">
<form id="mainForm" RunAt="server" style="vertical-align:top">
<asp:ScriptManager runat="server">
<Services>
<asp:ServiceReference Path="~/Manager/Admin/Admin.asmx" />
</Services>
<Scripts>
	<asp:ScriptReference Assembly="Dimok.Web.UI" Name="Dimok.Web.UI.JS.JQuery.js" />
	<asp:ScriptReference Assembly="Dimok.Web.UI" Name="Dimok.Web.UI.JS.Old.common.js" />
	<asp:ScriptReference Assembly="Dimok.Web.UI" Name="Dimok.Web.UI.JS.Old.Events.js" />
	<asp:ScriptReference Assembly="Dimok.Web.UI" Name="Dimok.Web.UI.JS.Old.RDS.js" />
	<asp:ScriptReference Assembly="Dimok.Web.UI" Name="Dimok.Web.UI.JS.Old.SOAP.js" />
	<asp:ScriptReference Assembly="Dimok.Web.UI" Name="Dimok.Web.UI.JS.Old.XML.js" />
	<asp:ScriptReference Assembly="Dimok.Web.UI" Name="Dimok.Web.UI.JS.Old.VIN.js" />
	<asp:ScriptReference Assembly="Dimok.Web.UI" Name="Dimok.Web.UI.JS.MSAjaxExtentions.js"/>
	<asp:ScriptReference Path="~/JS/UI/Dimok.PageEvents.js" />
</Scripts>
</asp:ScriptManager>
<SCRIPT language="javascript" src="/Include/Behavior.js"></SCRIPT>
<SCRIPT LANGUAGE="javascript" src="../Common/Common.js"></SCRIPT>
<SCRIPT language="javascript" src="/Manager/Common/Events.js"></SCRIPT>
<SCRIPT language="javascript" src="/Manager/Common/HTC/Common.js"></SCRIPT>
<script src="../Collection/Collection.js"></script>
<script language="javascript" src="ApplInfo.js"></script>
<COOL:TIP id="oTip" avoidmouse="true" DURATION="60"></COOL:TIP>
<XML id="XmlLoanInfo" Runat="server"></XML>
<asp:FormView DataSourceID="dsLoanInfo" ID="formView" runat="server" style="vertical-align:top"><ItemTemplate>
<table><tr VAlign="top"><td VAlign="top">
<UI:PlaceHolderJS ID="PlaceHolderJS1" runat="server">
<LOAN:Dealer ID="Dealer1" runat="server" style="display:block" onDealerChanged="reloadPage(arguments.callee.caller.arguments)" />
<fieldset style="border-color:Navy;display:inline;vertical-align:top">
<legend><label>BORROWERS</label><button onclick="pullCredit_Application()" style="height:10pt;margin-left:10px;overflow:visible;vertical-align:middle" class="VTOP">Pull credit</BUTTON></legend>
  <div><asp:PlaceHolder ID="phBorrowers" runat="server" OnLoad="phBorrowers_Load" /></div>
</fieldset>
<CAR:CAR runat="server" VIN='<%#Eval("VIN")%>' style="display:inline" id="car"
				 onvinchange='return doLoanVinChange(event)' onbookvaluechange="reloadPage(null)" />
<fieldset style="border-color:Maroon;display:inline;clear:both;vertical-align:top"><legend><label style="color:#4D0028">CONTRACT</label></legend><div>
<LOAN:BUYERSORDER runat="server" style="display:inline" ID="bo" ondecisionchanged="reloadPage(arguments.callee.caller.arguments)" />
<LOAN:TruthInLending runat="server" style="display:inline" ID="til" onTILChanged="reloadPage(arguments.callee.caller.arguments)" />
<LOAN:PurchaseContract style="display:inline" ID="pc" runat="server" />
</div></fieldset>
<div style="color:#00661A;font-weight:bold;text-decoration:blink;margin-left:5px;clear:left">Send To:
<br />
<UI:LoanStatus ID="LoanStatus1" StatusFromID='<%#Eval("StatusID")%>' WSMethod="LoanStatus" runat="server" style="display:block" />
</div>
</UI:PlaceHolderJS>
</td></tr></table>
</ItemTemplate></asp:FormView>
<input type="button" value="Upload to Vantage" onclick="uploadToVantage()" style="display:none" />
</form>
<DS:LoanInfosDataSource ID="dsLoanInfo" runat="server"><SelectParameters><asp:ControlParameter Name="LoanID" PropertyName="LoanID" Type="Int32" /></SelectParameters></DS:LoanInfosDataSource>
<script language="javascript">
	function page_Load() {
	initWS("APPL_INFO","Application.asmx?WSDL");
	initInputs();
}
//function uploadToVantage() {
//      $J.ajax({
//        async: false,
//        type: "POST",
//        url: "/manager/vantage/ws.asmx/SavePagePosition",
//        data: String.format("pageName={0}&top={1}&left={2}&width={3}&height={4}", this.get_pageType(), screenTop, screenLeft, html.offsetWidth, html.offsetHeight)
//}
function pullCredit_Application(){
	if( pullCredit() )reloadPage();
}
function reloadPage(ret){
	//initWS("DECISION","/Manager/Underwriting/Decision.asmx");
	if( event.srcElement != bo) bo.reloadMe(ret);
	if( event.srcElement != til) til.reloadMe(ret);
	if( event.srcElement != pc) pc.reloadMe(ret);
}
function doLoanVinChange(ev){
	var ret = WS(CO("Loan_TrackerRequestID"),ev.VIN);
	if( showSOAPError(ret) )return event.returnValue = false;
	if( ret.value )alert("Tracker Reaquest "+ret.value+" will be updated with new dealer -> "+selDealers.value);
	//var updateRequest = ret.value > 0 ? messageBox("Update Request "+ret.value+" with new VIN?") : false;
	//if( updateRequest === null )return event.returnValue = false;
	ret = WS(CO("Loan_VIN"),ev.VIN||null,ret.value);
	if( showSOAPError(ret) )return ev.returnValue = false;
}
function swapFrames(doc){
	if( top.isReversed == undefined )return;
	var sels = doc.all.tags("SELECT");
	var frameSet = window.frameElement.parentElement;
	for( var i=0; i < sels.length; i++ )
		sels[i].style.display = "none";
	frameSet.all["frmApplInfo"].swapNode(frameSet.all["frmZero"])
	//frameSet.all["frmApplImage"].src += "&Time="+new Date().valueOf();
	frameSet.cols = frameSet.cols.split(",").reverse()+'';
	top.isReversed = !top.isReversed;
	for( i=0; i < sels.length; i++ )
		sels[i].style.display = "";

}
</script>
</body>
</HTML>
